package com.it.sun.redismq.context;

import com.it.sun.redismq.annotation.MessageConsumer;
import com.it.sun.redismq.annotation.MessageListener;
import com.it.sun.redismq.vo.Message;

/**
 * @ClassName com.it.sun.redismq.context.MqConsumer
 * @Author sun
 * @Date 2021/1/28 10:47
 * @Version V1.0
 * Description  <请输入一句话描述该类功能>
 * Copyright (C) XXX  since 2021/1/28
 */
@MessageConsumer
public class MqConsumer {

    @MessageListener(topic = "topic1", mode = MessageListener.Mode.TOPIC)
    public void testTopic1(Message message) {
        System.out.println ("topic===> " + message);
    }

    @MessageListener(topic = "topic2", mode = MessageListener.Mode.TOPIC)
    public void testTopic2(Message message) {
        System.out.println ("topic===> " + message);
    }

    @MessageListener(topic = "topic3", mode = MessageListener.Mode.TOPIC)
    public void testTopic3(Message message) {
        System.out.println ("topic===> " + message);
    }

    @MessageListener(channel = "pubsub", mode = MessageListener.Mode.PUBSUB)
    public void testPubsub1(Message message) {
        System.out.println ("pubsub===> " + message);
    }

    @MessageListener(channel = "pubsub", mode = MessageListener.Mode.PUBSUB)
    public void testPubsub2(Message message) {
        System.out.println ("pubsub===> " + message);
    }
}



